<template>
  <div class="building">
    <div class="buildingHead">
      <div class="item" :class="{'active':acitveIndex == 0}" @click="tabClick(0)">
        10楼
      </div>
      <div class="item" :class="{'active':acitveIndex == 1}" @click="tabClick(1)">
        12楼
      </div>
    </div>
    <div class="buildingBody">
      <div class="buildingInner" v-if="acitveIndex == 0">
        <router-link to="/DP4" custom >
          <img src="./assets/poster.png" alt="" />
        </router-link>
      </div>
      <div class="buildingInner" v-if="acitveIndex == 1">
        <router-link to="/DP4" custom >
          <img src="./assets/poster2.png" alt="" />
        </router-link>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "item",
  data() {
    return {
      acitveIndex: 0
    }
  },
  mounted() {

  },
  methods: {
    tabClick(index) {
      this.acitveIndex = index
    }
  },
}
</script>

<style lang="scss" scoped>
.building {
  height: 100%;
  position: relative;

  .buildingHead {
    position: absolute;
    display: flex;
    height: 40px;
    padding: 1px 18px;
    background-image: url('assets/tab.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 1;

    .item {
      color: rgba(255, 255, 255, 0.5);
      background-image: url('assets/item.png');
      background-repeat: no-repeat;
      background-size: 100% 100%;
      background-position: center center;
      width: 85px;
      text-align: center;
      font-size: 14px;
      line-height: 38px;
      height: 38px;
      position: relative;
      cursor: pointer;
      letter-spacing: 2px;
      margin: 0 4px;


      &.active {
        color: #fff;
        font-weight: 600;
        background-image: url('assets/item2.png');
      }
    }
  }

  .buildingBody{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bg.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    // background-color: rgba(0, 113, 176, 0.15);
    // border: 1px solid rgba(0, 178, 255, 0.25);


    .buildingInner{
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px;
      box-sizing: border-box;

      img{
        max-width: 100%;
        max-height: 100%;
      }
    }
  }
}
</style>
